package leetcode.other;

import java.util.Scanner;

/**
 * @author cyt
 * @create 2020-05-19 9:09
 */
public class _19 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int low = 0, hig = s.length() - 1;
        while (low < hig) {
            char c1 = s.charAt(low);
            char c2 = s.charAt(hig);
            if (c1 == c2) {
                low++;
                hig--;
            } else {
                boolean f1 = true, f2 = true;
                for (int i = low + 1, j = hig; i < j; i++, j--) {
                    if (s.charAt(i) != s.charAt(j)) {
                        f1 = false;
                        break;
                    }
                }
                for (int i = hig - 1, j = low; i > j; i--, j++) {
                    if (s.charAt(i) != s.charAt(j)) {
                        f2 = false;
                        break;
                    }
                }

            }
        }
        return;
    }
}
